package com.example.demo.study.collection;

import java.util.LinkedList;
import java.util.Queue;

public class QueueTry {
    public static void main(String[] args) {
        Queue<Integer> queue=new LinkedList<>();
        queue.offer(5);
        queue.offer(6);
        queue.offer(7);
        queue.offer(8);
        System.out.println("peek is : "+queue.peek());
        System.out.println(queue);
        System.out.println("poll element:"+queue.poll());
        System.out.println(queue);
    }
}
